libxc: Fix xc_vcpu_{set,get}_affinity (Xen-bugzilla No.900).
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 15 Feb 2007 13:36:00 +0000 (13:36 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 15 Feb 2007 13:36:00 +0000 (13:36 +0000)
http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=900

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
tools/libxc/xc_domain.c

index 73d229dc61af5003f4a412b1e685204061f02cbf..6e3b0d9e8267b28d58f9ada150b007b2f85aed9a 100644 (file)
@@ -102,7 +102,7 @@ int xc_vcpu_setaffinity(int xc_handle,
     domctl.domain = (domid_t)domid;
     domctl.u.vcpuaffinity.vcpu    = vcpu;
 
-    bitmap_64_to_byte(local, &cpumap, sizeof (cpumap));
+    bitmap_64_to_byte(local, &cpumap, sizeof(cpumap) * 8);
 
     set_xen_guest_handle(domctl.u.vcpuaffinity.cpumap.bitmap, local);
 
@@ -148,7 +148,7 @@ int xc_vcpu_getaffinity(int xc_handle,
     ret = do_domctl(xc_handle, &domctl);
 
     unlock_pages(local, sizeof (local));
-    bitmap_byte_to_64(cpumap, local, sizeof (local));
+    bitmap_byte_to_64(cpumap, local, sizeof(local) * 8);
  out:
     return ret;
 }